package com.vm.myview;

import android.app.Activity;
import android.content.Context;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.vm.model.Comment;
import com.wwtscapp.apk.R;

/**   
 *  
 * @ProjectName:  [WeiMai] 
 * @Author:       [kent.wang]
 * @CreateDate:   [2015年4月1日 下午4:11:47]   
 * @Version:      [v1.0] 
 *    
 */
public class ViewComment {

	//	private View view;
	Activity activity;

	public ViewComment(Context context, Activity activity) {
		this.activity = activity;

	}

	/**
	 * 动态创建LinearLayout
	 * 
	 * @param i
	 * @param comment
	 *           
	 * @return
	 */
	public RelativeLayout dyAddView(int i, final Comment comment) {

		
		RelativeLayout linearLayout = (RelativeLayout) activity.getLayoutInflater()
				.inflate(R.layout.comments_item, null);
//		if (i == 0) {
//			mImageLoader = new ImageLoader(mQueue, new BitmapCache());
//		}
		
		TextView tv_userName = (TextView)linearLayout.findViewById(R.id.tv_userName);
		TextView tv_comment_time = (TextView)linearLayout.findViewById(R.id.tv_comment_time);
		TextView tv_content = (TextView)linearLayout.findViewById(R.id.tv_content);
		
		tv_userName.setText(comment.getCName());
		tv_comment_time.setText(comment.getCTime());
		tv_content.setText(comment.getCContent());
		
		return linearLayout;
	}

}
